import request from '@/router/axios';
import website from '@/config/website';
import {exportFunc} from "@/api/export";

//获取设计目标详情
export const getGoalDetail = (params) => {
  return request({
    url: '/api/hg-public/projectdesigngoal/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//获取阶段目标
export const getStages = (params) => {
  return request({
    url: '/api/hg-public/projectdesigngoal/getPhasesGoal',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//保存设计目标
export const saveStages = (row) => {
  return request({
    url: '/api/hg-public/projectdesigngoal/submit',
    method: 'post',
    data: row
  })
}
//导出
export const goalExport = (id, headers) => {
  var strids = 'id=' + id
  exportFunc('/hg-public/projectdesigngoal/exportpdf', headers, strids, '项目设计目标.pdf')
  // window.location.href = `${website.exportUrl}/hg-public/projectdesigngoal/exportpdf?id=${id}`
}

//确认阶段目标
export const confirm = (params) => {
  return request({
    url: '/api/hg-public/projectdesigngoal/confirm',
    method: 'get',
    params: {
      ...params,
    }
  })
}